home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_swaphat.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  64 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_SwapHat.cog
  4. #
  5. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  6. #
  7. # ===================================================================
  8.  
  9. symbols
  10.  
  11.     message        startup
  12.  
  13.     model        noHatHead=head_in_goodhair.3do        local
  14.  
  15.     thing        indy
  16.     thing        player                            local
  17.  
  18.     int            headMesh                        local
  19.     int            hatMesh                            local
  20.     int            meshRef                            local
  21.     int            headMeshRef                        local
  22.     int            hatMeshRef                        local
  23.  
  24. end
  25.  
  26. # ===================================================================
  27.  
  28. code
  29.  
  30. startup:
  31.  
  32.     player = GetLocalPlayerThing();
  33.  
  34.     # Get the int that represents Indy's hat
  35.     headMesh = GetMeshByName(player, "inhead");
  36.     hatMesh = GetMeshByName(player, "inhat");
  37.  
  38.     # Get rid of the hat -- remember the reference # we get back so
  39.     # it can be swapped back later
  40.     headMeshRef = SetThingMesh(indy, headMesh, noHatHead, 0);
  41.     hatMeshRef = SetThingMesh(indy, hatMesh, noHatHead, 1);
  42.  
  43.     # Set up no-hat heads...
  44.     SetThingVoiceHeads(indy, "inhead", "head_in_goodhair.3do", "head_in_asound_gh.3do", "head_in_amsound_gh.3do", "head_in_osound_gh.3do");
  45.     
  46.     # Make the actor visible
  47.     ClearThingFlags(indy, 0x80000);
  48.  
  49.     Sleep(5);
  50.  
  51.     # Make the actor invisible
  52.     SetThingFlags(indy, 0x80000);
  53.  
  54.     # Put the hat back on
  55.     RestoreThingMesh(indy, headMeshRef);
  56.     RestoreThingMesh(indy, hatMeshRef);
  57.  
  58.     # Restore default heads...
  59.     SetThingVoiceHeads(indy, "inhead", "", "head_in_asound.3do", "head_in_amsound.3do", "head_in_osound.3do");
  60.     
  61.  
  62.     return;
  63.  
  64. end